﻿namespace CxRomos.Core.Domain.Entities {
    public class AccountPermission {
        public AccountPermission() { }

        public virtual int Apid { get; set; }
        public virtual int AccountId { get; set; }
        public virtual Permission Permission { get; set; }

        public override int GetHashCode() {
            int toReturn = base.GetHashCode();
            toReturn ^= Apid.GetHashCode();
            return toReturn;
        }

        public override bool Equals(object obj) {
            if (obj == null) {
                return false;
            }
            var toCompareWith = obj as AccountPermission;
            return toCompareWith == null ? false : (Apid == toCompareWith.Apid);
        }
    }
}